<?php

use think\migration\Migrator;
use think\migration\db\Column;

class CreateAccountToken extends Migrator
{

    public function up()
    {
        $table = $this->table('account_token',['comment'=>'公众号access_token表']);
        $table->addColumn('app_id','string',['limit'=>32,'comment'=>'公众号appid'])
            ->addColumn('app_secret','string',['limit'=>120,'comment'=>'公众号appsecret'])
            ->addColumn('access_token','string',['limit'=>512,'comment'=>'公众号access_roken'])
            ->addColumn('access_token_expire_time','integer',['limit'=>10,'comment'=>'access_token过期时间'])
            ->addColumn('jsapi_ticket','string',['limit'=>512,'default'=>'','comment'=>'通过access_token得到jsapi_ticket'])
            ->addColumn('jsapi_ticket_expire_time','integer',['limit'=>10,'default'=>0,'comment'=>'jsapi_ticket过期时间'])
            ->addColumn('create_time','datetime',['comment'=>'创建时间'])
            ->addColumn('update_time','datetime',['comment'=>'更新时间'])
            ->create();
    }
    public function down(){
        $this->dropTable('account_token');
    }
}
